<?php
/*
 * @Author: your name
 * @Date: 2020-06-29 16:04:46
 * @LastEditTime: 2020-08-11 15:38:04
 * @LastEditors: 天羽落星辰
 * @Description: In User Settings Edit
 * @FilePath: \WWW\frx\application\admin\model\Chart.php
 */ 

namespace app\admin\model;

use think\Model;


class Chart extends Model
{

    

    

    // 表名
    protected $name = 'chart';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];

    public function getStatusList()
    {
        return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
    }

    public function category()
    {
        return ['首页轮播图','广告位'];
    }

    public function notice_title()
    {
        return db('notice')->field('id,title')->where('status','normal')->column('title','id');
    }


    public function notice()
    {
        return $this->belongsTo('Notice', 'notice_id', 'id');
    }
    

    







}
